package com.mryx.demo.controller;

import com.alibaba.fastjson.JSON;
import com.mryx.demo.service.AdminService;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@CrossOrigin
@RequestMapping("/admin")
public class AdminController {

    @Resource(name = "adminService")
    AdminService service;

    @PostMapping("/login")
    public String login(String userName,String passWord){
        return JSON.toJSONString(service.Login(userName, passWord));
    }

}
